package com.wzx.common.exception;

import com.wzx.common.constants.StatusCode;

/**
 * @author wzx
 * @version 1.0
 * @date 2023/9/27 - 13:02
 * @description 标题
 */
public class NeedCodeException extends Exception{
    /**错误的状态码*/
    private Integer code;
    /**错误信息*/
    private String message;

    public NeedCodeException(){

    }

    public NeedCodeException(Integer code, String message){
        this.code=code;
        this.message=message;
    }

    public NeedCodeException(String message){
        //自定义的异常的状态
        this.code= StatusCode.NOT_FOUND.code();
        this.message=message;
    }


    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
